/*
 * @Description: 打卡
 * @Author: iamsmiling
 * @Date: 2021-05-26 22:27:01
 * @LastEditTime: 2021-05-26 23:16:34
 */

import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/common_kit/color_kit.dart';
import 'package:flutter/material.dart';

class ClockDayEntity {
  late String date;

  ///是否已经打卡
  late bool clocked;

  late bool isToday;

  ClockDayEntity(
      {this.clocked = false, required this.date, this.isToday = false});

  String get label => isToday
      ? "今日"
      : clocked
          ? "已签"
          : {
                "3": "刷新卡X1",
                "7": "刷新卡X1",
                "15": "联系卡X1",
                "23": "置顶卡X1",
                "30": "VIP月卡"
              }[date] ??
              "";

  Color get labelColor => isToday
      ? ColorKit.fromHex("666666")
      : clocked
          ? ColorKit.fromHex("ffffff")
          : ColorKit.fromHex({
                "3": "ffffff",
                "7": "#05B2EB",
                "15": "#16A77A",
                "23": "#FF2850",
                "30": "#FD6805",
              }[date] ??
              "");

  double get labelSize => isToday || clocked ? R.dimen.dp13 : R.dimen.sp10;

  Color get dateColor => ColorKit.fromHex(clocked ? "#FFFFFF" : "#333333");
  Color get dateBgColor => ColorKit.fromHex(clocked ? "#288D58" : "#DDDDDD");

  LinearGradient? get linearGradient => clocked
      ? LinearGradient(colors: [
          ColorKit.fromHex("#67CA96"),
          ColorKit.fromHex("#68CC96"),
          ColorKit.fromHex("#57C78A"),
          ColorKit.fromHex("#20BB8D")
        ])
      : null;

  Color? get bgColor => clocked ? null : ColorKit.fromHex("#F0F0F0");
}
